package com.memo4android.ui;

import com.memo4android.NoteActivity;
import com.memo4android.model.ItemNote;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;

public class NoteClickedListener implements OnClickListener {

	private ItemNote note;
	private Context context;
	private Activity activity;
	
	public NoteClickedListener(Context context, ItemNote note){
		this.note = note;
		this.context = context;
		this.activity = (Activity) context;
	}
	
	public void onClick(View v) {
		Intent intent = new Intent(context, NoteActivity.class);
		intent.putExtra("folderName", note.getParent().getTitre());
		intent.putExtra("noteName", note.getTitre());
		activity.startActivity(intent);
	}

}
